<template>
	<view class="pay-result">
		<image
			class="pay-result-img"
			:src="result ? '../../static/images/pay-success.png' : '../../static/images/pay-fail.png'"
			mode="aspectFill">
		</image>
		<view class="pay-result-txt">
			{{result ? ' 申请成功' : '支付失败'}}
		</view>
		<view class="pay-result-detail">
			{{
				result ? 
				' 我们将尽快审核您的申请，审核通过将进行发货，请保持手机通讯畅通，以便快递员能够第一时间联系您。' : 
				'该订单因某些原因申请失败，请重试！'
			}}
		</view>
		<button
			v-if="result"
			class="pay-result-btn btn-success"
			@click="pageTo('/pages/user/userOrder?active=1')">
			查看订单
		</button>
		<button
			v-if="!result"
			class="pay-result-btn"
			@click="pageTo('/pages/user/userOrder?active=1')">
			重新申请
		</button>
	</view>
</template>

<script>
	export default {
		components: {
		},
		data() {
			return {
				result: 1,
				tryout: 1
			}
		},
		onLoad(option) {
			this.result = Number(option.result)
			this.tryout = Number(option.tryout)
		},
		methods: {
			/**
			 * 跳转
			 * @param {String} page
			 */
			pageTo(page) {
				uni.navigateTo({
					url: page
				});
			}
		}
	}
</script>

<style lang="scss">
	.pay-result{
		text-align: center;
		.pay-result-img{
			width: 120rpx;
			height: 120rpx;
			margin: 100rpx auto 0;
		}
		.pay-result-txt{
			// line-height: 120rpx;
		}
		.pay-result-detail{
			padding: 0 160rpx;
			font-size: $uni-font-size-sm1;
			color: $uni-text-color-grey;
		}
		.pay-result-btn{
			margin-top: 146rpx;
			width: 300rpx;
			height: 70rpx;
			line-height: 70rpx;
			border-radius: 35px;
			font-size: $uni-font-size-base;
			border: solid 1px $uni-border-color;
		}
		.btn-success{
			background: $uni-color-theme;
			color: $uni-text-color-inverse;
		}
	}
</style>
